//package com.itheima.publisher.config;
//
//import lombok.AllArgsConstructor;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.amqp.core.ReturnedMessage;
//import org.springframework.amqp.rabbit.core.RabbitTemplate;
//import org.springframework.context.annotation.Configuration;
//
//import javax.annotation.PostConstruct;
//
//@Slf4j
//@AllArgsConstructor
//@Configuration
//public class MqConfig {
//    private final RabbitTemplate rabbitTemplate;
//
//    @PostConstruct
//    public void init() {
//        rabbitTemplate.setReturnsCallback(new RabbitTemplate.ReturnsCallback() {
//            @Override
//            public void returnedMessage(ReturnedMessage returned) {
//                log.error("触发return callback,");
//                log.debug("exchange: {}", returned.getExchange());
//                log.debug("routingKey: {}", returned.getRoutingKey());
//                log.debug("message: {}", returned.getMessage());
//                log.debug("replyCode: {}", returned.getReplyCode());
//                log.debug("replyText: {}", returned.getReplyText());
//            }
//        });
//    }
//}